﻿//-- =============================================
//-- Author:	    Saghari, Farid
//-- Create date:   1389/12/20
//-- Description:	ApplicationInfo Class
//-- E-Mail:    	fredmcs@live.com
//-- Mobile:        0937-241-3499
//-- Last Update:   1390/01/10 13:10
//-- =============================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChequeManagement.Common
{
    public class ApplicationInfo
    {
        private string bLLNamespace = "ChequeManagement.BLL";
        private string dAlNamespace = "ChequeManagement.DAL";
        private string tableName = string.Empty;

        public ApplicationInfo(string tableName)
        {
            this.tableName = tableName;
        }

        public string TableName
        {
            get
            {
                return (string.Format("[{0}]", this.tableName));
            }
        }

        public string BLLFactory
        {
            get
            {
                return (string.Format("BLL{0}Factory", this.tableName));
            }
        }

        public string DAL
        {
            get
            {
                return (string.Format("DAL{0}", this.tableName));
            }
        }

        public string BLLNameSpace
        {
            get
            {
                return (this.bLLNamespace);
            }
        }

        public string DALNameSpace
        {
            get
            {
                return (this.dAlNamespace);
            }
        }

        public string RootNameSpace
        {
            get
            {
                string[] resource = this.GetType().Assembly.EntryPoint.ReflectedType.Namespace.Split('.');

                if (resource.Length == 0)
                    return (string.Empty);
                else
                    return (resource[0]);
            }
        }

        public string BusinessLogicLayer
        {
            get
            {
                return (string.Format("{0}.{1}", this.BLLNameSpace, this.BLLFactory));
            }
        }

        public string DataAccessLayer
        {
            get
            {
                return (string.Format("{0}.{1}", this.DALNameSpace, this.DAL));
            }
        }
    }
}
